﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Runtime.InteropServices;


namespace gTray
{
    class Utilities
    {
        public const string Gmail_Feed_Address = "https://mail.google.com/mail/feed/atom";

        public enum AnimateWindowFlags : uint
        {
            AW_HOR_POSITIVE = 0x00000001,
            AW_HOR_NEGATIVE = 0x00000002,
            AW_VER_POSITIVE = 0x00000004,
            AW_VER_NEGATIVE = 0x00000008,
            AW_CENTER = 0x00000010,
            AW_HIDE = 0x00010000,
            AW_ACTIVATE = 0x00020000,
            AW_SLIDE = 0x00040000,
            AW_BLEND = 0x00080000
        }

        public enum TaskbarLocation
        {
            Top,
            Bottom,
            Left,
            Right
        }

        public static TaskbarLocation FindTaskbarLocation()
        {
            System.Drawing.Rectangle working = System.Windows.Forms.SystemInformation.WorkingArea;
            System.Drawing.Rectangle bounds = System.Windows.Forms.Screen.PrimaryScreen.Bounds;

            if (working.X == bounds.X)
            {
                if (working.Y == bounds.Y)
                    if (working.Width == bounds.Width)

                        return TaskbarLocation.Bottom;
                    else
                        return TaskbarLocation.Right;
                else
                    return TaskbarLocation.Top;
            }
            else
                return TaskbarLocation.Left;
        }

        [DllImport("user32")]
        public static extern bool AnimateWindow(IntPtr hwnd, int time, AnimateWindowFlags flags);
    }
}
